package com.merryituxz.o2o.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class MvcConfiguration implements WebMvcConfigurer {
    /**
     * 静态资源映射
     * 将/upload/**路径下的资源解析为C:/Users/Administrator/Desktop/upload/**
     * @param registry
     */
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/upload/**")
//                .addResourceLocations("file:C:/Users/Administrator/Desktop/upload/");
                .addResourceLocations("file:/root/o2o_image/upload/");
    }

}
